﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using __ts.Core.Session;

/*
 *  author: able
 *  @2012/2/21 17:31:26
 * 
 */
namespace __ts.Core.Transport.Tcp
{
    /// <summary>
    /// 
    /// </summary>
    public class DefaultSocketSessionConfig : AbstractIoSessionConfig, SocketSessionConfig
    {
        //=====================
        // buffers
        //=====================

        private int receiveBufferSize;

        /**
         * {@inheritDoc}
         */
        public int getReceiveBufferSize()
        {
            return receiveBufferSize;
        }

        /**
         * {@inheritDoc}
         */
        public void setReceiveBufferSize(int receiveBufferSize)
        {
            this.receiveBufferSize = receiveBufferSize;
        }

        private int sendBufferSize;

        /**
         * {@inheritDoc}
         */
        public int getSendBufferSize()
        {
            return sendBufferSize;
        }

        /**
         * {@inheritDoc}
         */
        public void setSendBufferSize(int sendBufferSize)
        {
            this.sendBufferSize = sendBufferSize;
        }

        //=====================
        // socket options
        //=====================

        private bool tcpNoDelay;

        /**
         * {@inheritDoc}
         */
        public bool isTcpNoDelay()
        {
            return tcpNoDelay;
        }

        /**
         * {@inheritDoc}
         */
        public void setTcpNoDelay(bool tcpNoDelay)
        {
            this.tcpNoDelay = tcpNoDelay;
        }

        private bool reuseAddress;

        /**
         * {@inheritDoc}
         */
        public bool isReuseAddress()
        {
            return reuseAddress;
        }

        /**
         * {@inheritDoc}
         */
        public void setReuseAddress(bool reuseAddress)
        {
            this.reuseAddress = reuseAddress;
        }

        private int trafficClass;

        /**
         * {@inheritDoc}
         */
        public int getTrafficClass()
        {
            return trafficClass;
        }

        /**
         * {@inheritDoc}
         */
        public void setTrafficClass(int trafficClass)
        {
            this.trafficClass = trafficClass;
        }

        private bool keepAlive;

        /**
         * {@inheritDoc}
         */
        public bool isKeepAlive()
        {
            return keepAlive;
        }

        /**
         * {@inheritDoc}
         */
        public void setKeepAlive(bool keepAlive)
        {
            this.keepAlive = keepAlive;
        }

        private bool oobInline;

        /**
         * {@inheritDoc}
         */
        public bool isOobInline()
        {
            return oobInline;
        }

        /**
         * {@inheritDoc}
         */
        public void setOobInline(bool oobInline)
        {
            this.oobInline = oobInline;

        }

        private int soLinger;

        /**
         * {@inheritDoc}
         */
        public int getSoLinger()
        {
            return soLinger;
        }

        /**
         * {@inheritDoc}
         */
        public void setSoLinger(int soLinger)
        {
            this.soLinger = soLinger;
        }
    }
}